﻿using System.Xml.Linq;
using Maple.Weixin.MP.Helpers;

namespace Maple.Weixin.MP.Entities.Messages
{
    public sealed class RequestMessageVideo : RequestMessageBase
    {
        public override RequestMessageType MsgType
        {
            get { return RequestMessageType.Video; }
        }

        public string MediaId { get; private set; }
        public string ThumbMediaId { get; private set; }

        protected override void FillPropertiesByXml(XDocument document)
        {
            base.FillPropertiesByXml(document);
            this.MediaId = document.GetElementValue("MediaId", true);
            this.ThumbMediaId = document.GetElementValue("ThumbMediaId", true);
        }

        public override T Accept<T>(RequestMessageVisitor<T> visitor) {
            return visitor == null ? default(T) : visitor.Visit(this);
        }
    }
}
